﻿using Org.Flowertwig.Media;

namespace MediaStreamer.Containers
{
    public class Navigation
    {
        private string _indexId;
        private string _pageId;

        public string Id { get; set; }
        public string PageId
        {
            get { return _pageId; }
            set { _pageId = value; GenerateId(); }
        }
        public string IndexId
        {
            get { return _indexId; }
            set { _indexId = value; GenerateId(); }
        }

        private void GenerateId()
        {
            if (string.IsNullOrEmpty(PageId) || string.IsNullOrEmpty(IndexId))
                return;

            Id = Hash.CreateId(string.Format("{0}:{1}", PageId, IndexId));
        }
    }
}